// 频道相关
import request from '@/utils/request'

/**
 * 获取用户频道
 * @returns
 */
export function getUserChannels() {
  return request({
    url: '/v1_0/user/channels'
  })
}

/**
 * 获取所有频道
 * @returns
 */
export function getAllChannels() {
  return request({
    url: '/v1_0/channels'
  })
}

/**
 * 设置用户频道
 * @param {*} channels 对象 频道id
 * @returns
 */
export function setChannel(channels) {
  return request({
    url: '/v1_0/user/channels',
    method: 'patch',
    data: {
      channels
    }
  })
}

/**
 * 删除指定频道
 * @param {*} target 频道id
 * @returns
 */
export function delChannel(target) {
  return request({
    url: `/v1_0/user/channels/${target}`,
    method: 'delete'
  })
}
